
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta charset="utf-8"></meta>
      <meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
      <title>9.1.&nbsp;Meta Graph - Chapter&nbsp;9.&nbsp;Schema Information and Operations</title>
      <link rel="stylesheet" type="text/css" href="../../docbook.css"></link>
      <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:400,300,400italic,600,300italic"></link>
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/codemirror.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/theme/neo.min.css"></link>
      <link rel="stylesheet" type="text/css" href="../../css/chunked-base.css"></link>
      <link rel="stylesheet" type="text/css" href="../../css/extra.css"></link><script src="//code.jquery.com/jquery-1.12.4.js" type="text/javascript"></script><script src="//cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js" type="text/javascript"></script><script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" type="text/javascript"></script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/codemirror.min.js" type="text/javascript"></script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/addon/runmode/runmode.min.js" type="text/javascript"></script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/mode/cypher/cypher.min.js" type="text/javascript"></script><script src="../../javascript/datatable.js" type="text/javascript"></script><script src="../../javascript/colorize.js" type="text/javascript"></script><script src="../../javascript/tabs-for-chunked.js" type="text/javascript"></script><script src="../../javascript/mp-nav.js" type="text/javascript"></script><script src="../../javascript/versionswitcher.js" type="text/javascript"></script><script src="../../javascript/version.js" type="text/javascript"></script><script src="//s3-eu-west-1.amazonaws.com/alpha.neohq.net/docs/new-manual/assets/search.js" type="text/javascript"></script><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"></meta>
      <link rel="prev" href="../" title="Chapter&nbsp;9.&nbsp;Schema Information and Operations"></link>
      <link rel="next" href="../../export-import/" title="Chapter&nbsp;7.&nbsp;Export / Import"></link>
      <link rel="shortcut icon" href="https://neo4j.com/wp-content/themes/neo4jweb/favicon.ico"></link><script>
        $(document).ready(function() {
          CodeMirror.colorize();
          tabTheSource($('body'));
          var $header = $('header').first();
          $header.prepend(
            $('<a href="" id="logo"><img src="https://neo4j.com/wp-content/themes/neo4jweb/assets/images/neo4j-logo-2015.png" alt="Neo4j Logo"></img></a>')
          );
          var $sidebar = $('<div id="sidebar-wrapper"></div>');
          $.get('toc.html', function (d){
            $(d).appendTo($sidebar);
            highlightToc();
            highlightLibraryHeader();
          });
          $sidebar.insertAfter($('header').first());
        });
        </script></head>
   <body>
      <header>
         <div class="searchbox">
            <form id="search-form" class="search" name="search-form" role="search"><input id="search-form-input" name="q" title="search" type="search" lang="en" placeholder="Search Neo4j docs..." aria-label="Search Neo4j documentation" max-length="128" required="required"></input><input id="search-form-button" type="submit" value="Search"></input></form>
         </div>
         <ul class="documentation-library">
            <li><a href="https://neo4j.com/docs/operations-manual/current">Operations Manual</a></li>
            <li><a href="https://neo4j.com/docs/developer-manual/current/">Developer Manual</a></li>
            <li><a href="https://neo4j.com/docs/ogm-manual/current/">OGM Manual</a></li>
            <li><a href="https://neo4j.com/docs/graph-algorithms/current/">Graph Algorithms</a></li>
            <li><a href="https://neo4j-contrib.github.io/neo4j-apoc-procedures/3.5/">APOC</a></li>
            <li><a href="https://neo4j.com/docs/java-reference/current/">Java Reference</a></li>
         </ul>
         <nav id="header-nav"><span class="nav-previous"><a accesskey="p" href="../"><span class="fa fa-long-arrow-left" aria-hidden="true"></span>Schema Information and Operations</a></span><span class="nav-current">
               <p class="nav-title hidden">9.1.&nbsp;Meta Graph</p></span><span class="nav-next"><a accesskey="n" href="../../export-import/">Export / Import<span class="fa fa-long-arrow-right" aria-hidden="true"></span></a></span></nav>
      </header>
      <div id="search-results" class="hidden"></div>
      <section class="section" id="meta-graph">
         <div class="titlepage">
            <div>
               <div>
                  <h2 class="title" style="clear: both"><a class="anchor" href="#meta-graph"></a>9.1.&nbsp;Meta Graph
                  </h2>
               </div>
            </div>
         </div>
         <div class="informalfigure">
            <div class="mediaobject"><img src="https://raw.githubusercontent.com/neo4j-contrib/neo4j-apoc-procedures/3.4/docs/images/apoc.meta.graph.jpg" width="600" alt="apoc.meta.graph"></img></div>
         </div>
         <p>Returns a virtual graph that represents the labels and relationship-types available in your database and how they are connected.</p>
         <div class="table" id="d0e10624">
            <table class="table" summary="Procedures" border="1">
               <caption class="table-title">Table&nbsp;9.1.&nbsp;Procedures</caption>
               <colgroup>
                  <col class="col_1"></col>
                  <col class="col_2"></col>
               </colgroup>
               <tbody>
                  <tr>
                     <td style="text-align: left; vertical-align: top; ">
                        <p><code class="literal">CALL apoc.meta.graphSample()</code></p>
                     </td>
                     <td style="text-align: left; vertical-align: top; ">
                        <p>examines the database statistics to build the meta graph, very fast, might report extra relationships</p>
                     </td>
                  </tr>
                  <tr>
                     <td style="text-align: left; vertical-align: top; ">
                        <p><code class="literal">CALL apoc.meta.graph</code></p>
                     </td>
                     <td style="text-align: left; vertical-align: top; ">
                        <p>examines the database statistics to create the meta-graph, post filters extra relationships by sampling</p>
                     </td>
                  </tr>
                  <tr>
                     <td style="text-align: left; vertical-align: top; ">
                        <p><code class="literal">CALL apoc.meta.subGraph({labels:[labels],rels:[rel-types],excludes:[label,rel-type,&#8230;&#8203;]})</code></p>
                     </td>
                     <td style="text-align: left; vertical-align: top; ">
                        <p>examines a sample sub graph to create the meta-graph</p>
                     </td>
                  </tr>
                  <tr>
                     <td style="text-align: left; vertical-align: top; ">
                        <p><code class="literal">CALL apoc.meta.data</code></p>
                     </td>
                     <td style="text-align: left; vertical-align: top; ">
                        <p>examines a subset of the graph to provide a tabular meta information</p>
                     </td>
                  </tr>
                  <tr>
                     <td style="text-align: left; vertical-align: top; ">
                        <p><code class="literal">CALL apoc.meta.schema</code></p>
                     </td>
                     <td style="text-align: left; vertical-align: top; ">
                        <p>examines a subset of the graph to provide a map-like meta information</p>
                     </td>
                  </tr>
                  <tr>
                     <td style="text-align: left; vertical-align: top; ">
                        <p><code class="literal">CALL apoc.meta.stats  yield labelCount, relTypeCount, propertyKeyCount, nodeCount, relCount, labels, relTypes, stats</code></p>
                     </td>
                     <td style="text-align: left; vertical-align: top; ">
                        <p>returns the information stored in the transactional database statistics</p>
                     </td>
                  </tr>
               </tbody>
            </table>
         </div>
         <div class="table" id="d0e10679">
            <table class="table" summary="Functions" border="1">
               <caption class="table-title">Table&nbsp;9.2.&nbsp;Functions</caption>
               <colgroup>
                  <col class="col_1"></col>
                  <col class="col_2"></col>
               </colgroup>
               <tbody>
                  <tr>
                     <td style="text-align: left; vertical-align: top; ">
                        <p><code class="literal">apoc.meta.cypher.type(value)</code></p>
                     </td>
                     <td style="text-align: left; vertical-align: top; ">
                        <p>type name of a value (<code class="literal">INTEGER,FLOAT,STRING,BOOLEAN,RELATIONSHIP,NODE,PATH,NULL,MAP,LIST OF &lt;TYPE&gt;,POINT,DATE,DATE_TIME,LOCAL_TIME,LOCAL_DATE_TIME,TIME,DURATION</code>)
                        </p>
                     </td>
                  </tr>
                  <tr>
                     <td style="text-align: left; vertical-align: top; ">
                        <p><code class="literal">apoc.meta.cypher.isType(value,type)</code></p>
                     </td>
                     <td style="text-align: left; vertical-align: top; ">
                        <p>returns a row if type name matches none if not</p>
                     </td>
                  </tr>
                  <tr>
                     <td style="text-align: left; vertical-align: top; ">
                        <p><code class="literal">apoc.meta.cypher.types(node or relationship or map)</code></p>
                     </td>
                     <td style="text-align: left; vertical-align: top; ">
                        <p>returns a a map of property-keys to their names</p>
                     </td>
                  </tr>
               </tbody>
            </table>
         </div>
         <p>In the case of <code class="literal">LIST</code> you may have many results, depending on the content. In the event that all contents are of the same type, will you have the
            <code class="literal">LIST OF &lt;TYPE&gt;</code>, otherwise if the type is different, will you get <code class="literal">LIST OF ANY</code></p>
         <p>If no type was found, the function return name of the class.</p>
         <div class="table" id="d0e10725">
            <table class="table" summary="Functions Deprecated" border="1">
               <caption class="table-title">Table&nbsp;9.3.&nbsp;Functions Deprecated</caption>
               <colgroup>
                  <col class="col_1"></col>
                  <col class="col_2"></col>
               </colgroup>
               <tbody>
                  <tr>
                     <td style="text-align: left; vertical-align: top; ">
                        <p><code class="literal">apoc.meta.type(value)</code></p>
                     </td>
                     <td style="text-align: left; vertical-align: top; ">
                        <p>type name of a value (<code class="literal">INTEGER,FLOAT,STRING,BOOLEAN,RELATIONSHIP,NODE,PATH,NULL,MAP,LIST</code>)
                        </p>
                     </td>
                  </tr>
                  <tr>
                     <td style="text-align: left; vertical-align: top; ">
                        <p><code class="literal">apoc.meta.isType(value,type)</code></p>
                     </td>
                     <td style="text-align: left; vertical-align: top; ">
                        <p>returns a row if type name matches none if not</p>
                     </td>
                  </tr>
                  <tr>
                     <td style="text-align: left; vertical-align: top; ">
                        <p><code class="literal">apoc.meta.types(node or relationship or map)</code></p>
                     </td>
                     <td style="text-align: left; vertical-align: top; ">
                        <p>returns a a map of property-keys to their names</p>
                     </td>
                  </tr>
               </tbody>
            </table>
         </div>
         <p>If no type was found, the function return name of the class.</p>
         <p><span class="formalpara-title">isType example.&nbsp;</span>
            
         </p><pre class="programlisting highlight"><code data-lang="cypher">MATCH (n:Person)
RETURN apoc.meta.isType(n.age,"INTEGER") as ageType</code></pre><p>
            
         </p>
      </section>
      <footer><script type="text/javascript">
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
          //Allow Linker
          ga('create', 'UA-1192232-34','auto', {'allowLinker': true});
          ga('send', 'pageview');
          // Load the plugin.
          ga('require', 'linker');
          // Define which domains to autoLink.
          ga('linker:autoLink', ['neo4j.org','neo4j.com','neotechnology.com','graphdatabases.com','graphconnect.com']);
        </script><script type="text/javascript">
          document.write(unescape("%3Cscript src='//munchkin.marketo.net/munchkin.js' type='text/javascript'%3E%3C/script%3E"));
        </script><script>Munchkin.init('773-GON-065');</script></footer>
   </body>
</html>